using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.Graphics;
using System.Net;

namespace EightBeats
{
    [Activity(Label = "About the Author")]
    public class AuthorActivity : Activity
    {
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "author" layout resource
            SetContentView(Resource.Layout.Author);

            //Set Author Image
            ImageView imgAuthor = FindViewById<ImageView>(Resource.Id.imgAuthor);
            imgAuthor.SetImageResource(Resource.Drawable.author);

            // Get our button from the layout resource,
            // and attach an event to it
            Button btnWebsite = FindViewById<Button>(Resource.Id.btnWebsite);
            btnWebsite.Click += delegate {
                var uri = Android.Net.Uri.Parse("http://www.thiagosantos.com.br");
                var intent = new Intent(Intent.ActionView, uri);
                StartActivity(intent);   
            };

            Button btnEmail = FindViewById<Button>(Resource.Id.btnEmail);
            btnEmail.Click += delegate
            {
                var email = new Intent(Android.Content.Intent.ActionSend);
                email.PutExtra(Android.Content.Intent.ExtraEmail,new string[] { "thiagosantos@thiagosantos.com.br" });
                email.PutExtra(Android.Content.Intent.ExtraSubject, "[8Beats for Android] - Contact");
                email.SetType("message/rfc822");
                StartActivity(email);
            };

            Button btnLinkedin = FindViewById<Button>(Resource.Id.btnLinkedin);
            btnLinkedin.Click += delegate
            {
                var uri = Android.Net.Uri.Parse("http://ae.linkedin.com/in/thiagonsantos");
                var intent = new Intent(Intent.ActionView, uri);
                StartActivity(intent);   
            };

            Button btnTwitter = FindViewById<Button>(Resource.Id.btnTwitter);
            btnTwitter.Click += delegate
            {
                var uri = Android.Net.Uri.Parse("https://twitter.com/thsantosdxb");
                var intent = new Intent(Intent.ActionView, uri);
                StartActivity(intent);  
            };
        }
    }
}